package net.lookyou.boot.demo.mapper;

import net.lookyou.boot.demo.entity.SysUserRole;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SysUserRoleMapper {
    @Select("SELECT * FROM sys_user_role WHERE user_id = #{userId}")
    List<SysUserRole> listByUserId(Integer userId);

    @Insert({"INSERT INTO sys_user_role (user_id,role_id) VALUES(#{userId},#{roleId})"})
    int registerAuthority(Integer userId,Integer roleId);
}
